# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ToolResults.V1beta3.Model.Outcome do
  @moduledoc """
  Interprets a result so that humans and machines can act on it.

  ## Attributes

  *   `failureDetail` (*type:* `GoogleApi.ToolResults.V1beta3.Model.FailureDetail.t`, *default:* `nil`) - More information about a FAILURE outcome. Returns INVALID_ARGUMENT if this field is set but the summary is not FAILURE. Optional
  *   `inconclusiveDetail` (*type:* `GoogleApi.ToolResults.V1beta3.Model.InconclusiveDetail.t`, *default:* `nil`) - More information about an INCONCLUSIVE outcome. Returns INVALID_ARGUMENT if this field is set but the summary is not INCONCLUSIVE. Optional
  *   `skippedDetail` (*type:* `GoogleApi.ToolResults.V1beta3.Model.SkippedDetail.t`, *default:* `nil`) - More information about a SKIPPED outcome. Returns INVALID_ARGUMENT if this field is set but the summary is not SKIPPED. Optional
  *   `successDetail` (*type:* `GoogleApi.ToolResults.V1beta3.Model.SuccessDetail.t`, *default:* `nil`) - More information about a SUCCESS outcome. Returns INVALID_ARGUMENT if this field is set but the summary is not SUCCESS. Optional
  *   `summary` (*type:* `String.t`, *default:* `nil`) - The simplest way to interpret a result. Required
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :failureDetail => GoogleApi.ToolResults.V1beta3.Model.FailureDetail.t() | nil,
          :inconclusiveDetail => GoogleApi.ToolResults.V1beta3.Model.InconclusiveDetail.t() | nil,
          :skippedDetail => GoogleApi.ToolResults.V1beta3.Model.SkippedDetail.t() | nil,
          :successDetail => GoogleApi.ToolResults.V1beta3.Model.SuccessDetail.t() | nil,
          :summary => String.t() | nil
        }

  field(:failureDetail, as: GoogleApi.ToolResults.V1beta3.Model.FailureDetail)
  field(:inconclusiveDetail, as: GoogleApi.ToolResults.V1beta3.Model.InconclusiveDetail)
  field(:skippedDetail, as: GoogleApi.ToolResults.V1beta3.Model.SkippedDetail)
  field(:successDetail, as: GoogleApi.ToolResults.V1beta3.Model.SuccessDetail)
  field(:summary)
end

defimpl Poison.Decoder, for: GoogleApi.ToolResults.V1beta3.Model.Outcome do
  def decode(value, options) do
    GoogleApi.ToolResults.V1beta3.Model.Outcome.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.ToolResults.V1beta3.Model.Outcome do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
